﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using MockSchoolManagement.Core.Repositories;
using MockSchoolManagement.Domain.Students;
using System.Threading.Tasks;

namespace MockSchoolManagement.Mvc.Controllers.CourseController
{
    [AllowAnonymous]
    public class CourseController : Controller
    {
        private IRepository<Student, int> _repository;

        public CourseController(IRepository<Student, int> repository)
        {
            _repository = repository;
        }

        public async Task<string> Index()
        {
           var list= await _repository.GetAll().FirstOrDefaultAsync();
           var longcount = await _repository.LongCountAsync();
           var count = await _repository.CountAsync();
           return $"{list.Name}+{longcount}+{count}";
           // return View();
        }
    }
}
